﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BaiduSpeech
{
    class Program
    {

        static void Main(string[] args)
        {
            // 设置APPID/AK/SK
            var APP_ID = "14437694";
            var API_KEY = "6oytd4fM4t62ucptNPRCUER7";
            var SECRET_KEY = "gOQUdDcLpRSYIzGaW01ydA9GRDEYYAhb";

            var client = new Baidu.Aip.Speech.Asr(APP_ID, API_KEY, SECRET_KEY);
            client.Timeout = 60000;  // 修改超时时间
            var data = File.ReadAllBytes(@"D:\FFOutput\testmusic.wav");
            client.Timeout = 330000; // 若语音较长，建议设置更大的超时时间. ms,最长60s 即60*1000 ms
            Dictionary<string, object> dic = new Dictionary<string, object>();
            dic.Add("dev_pid", 1536);
            var result = client.Recognize(data, "pcm", 16000, dic);
            Console.Write(result);
            Console.Read();
        }

        public void AsrData()
        {
            
        }
    }
}
